<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="icon" href="../../favicon.ico">

	<title>Blog Template for Bootstrap</title>

	<!-- Bootstrap core CSS -->
	<link rel="stylesheet" type="text/css" href="/A/Public/Css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="/A/Public/Css/css/app.css" />
</head>
<body>
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">添加店铺</h4>

						<div class="progress active" style="display:none;">
						  <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
						    <span class="sr-only">45% Complete</span>
						  </div>
						</div>


				</div>
				<div class="modal-body" id="con_shop">
					
					<div class="namecon">
						店铺名称：
						<input class="form-control" id="ipt_shopname" type="text" placeholder="xx电商"/>
					</div>
					<div class="descon">
						店铺描述：
						<textarea class="form-control" id="ipt_shopdes" rows="3"></textarea>
					</div>
					<div class="typecon">
						店铺类型选择：
					<select class="form-control" id="ipt_shoptype">
						<option></option>
						<option value="1">海鲜</option>
						<option value="2">水果</option>
						<option value="3">干货</option>
					</select>
					</div>
					
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭</button>
					<button type="button" id="btn_addshop" class="btn btn-primary">提交更改</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<div class="container con1">
		<div class="row">
			<div class="col-sm-3 sidebar">
				<ul class="nav nav-sidebar">
					<li class="active">
						<a href="#">
							商店A
							<span class="sr-only">(current)</span>
						</a>
					</li>
					<li>
						<a href="/A/Home/user/index?shopId=1">商店B</a>
					</li>
					<li>
						<a href="/A/Home/user/index?shopId=2">商店C</a>
					</li>
					<li>
						<a href="/A/Home/user/index?shopId=3">商店D</a>
					</li>
				</ul>

				<button class="btn btn-large btn-primary" type="button" data-toggle="modal"    data-target="#myModal">添加新条目</button>
			</div>
			<div class="col-sm-9">
				<h2 class="sub-header">请添加搜索条目</h2>
				<div class="table-responsive">
					<table class="table table-striped">
						<thead>
							<tr>
								<th>#</th>
								<th>url地址</th>
								<th>描述</th>
								<th>上次检查时间</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>1</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>2</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>3</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>4</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>5</td>
								<td>
									<input class="form-control" id="ds_host" type="text" placeholder="http://"/>
								</td>
								<td>
									<input class="form-control" id="ds_host" type="text" placeholder="建议描述分类和产品信息"/>
								</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td colspan="4" class="text-center">
									<button class="btn btn-large btn-primary" type="button">添加新条目</button>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<h2 class="sub-header">默认显示第一条</h2>
				<div class="table-responsive">
					<table class="table table-striped">
						<thead>
							<tr>
								<th>#</th>
								<th>url地址</th>
								<th>描述</th>
								<th>上次检查时间</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>1</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>2</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>3</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
							<tr>
								<td>4</td>
								<td>www.baidu.com</td>
								<td>搜索引擎</td>
								<td>20150831</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>

</body>
	<script type="text/javascript" src="/A/Public/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="/A/Public/js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btn_addshop").click(function(){
				var _n=$("#ipt_shopname").val();
				var _d=$("#ipt_shopdes").val();
				var _t=$("#ipt_shoptype").val();
				_n?$(".namecon").removeClass("has-error").addClass("has-success")
				  :$(".namecon").removeClass("has-success").addClass("has-error");
				_d?$(".descon").removeClass("has-error").addClass("has-success")
				  :$(".descon").removeClass("has-success").addClass("has-error");
				_t?$(".typecon").removeClass("has-error").addClass("has-success")
				  :$(".typecon").removeClass("has-success").addClass("has-error");
				// if(_n&&_d&&_t){
				if(1){
					$(".progress").show();
					$.ajax({
						url:"/A/Home/user/addShop?sn="+_n+"&sd="+_d+"&st="+_t,
						dataType: "json", 
						success: function(d){
							if(d.error){

							}
						}
					})
				}
				// console.log(_n,_d,_t);
			})
		})
	</script>
</html>